package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.GoodStyle;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IGoodStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/goodStyle")
public class GoodStyleController {
    @Autowired
    private IGoodStyleService goodStyleService;


    @RequestMapping("/list")
    public String list(@ModelAttribute("qo") QueryObject qo, Model model) {
        model.addAttribute("pageInfo", goodStyleService.query(qo));
        return "goodStyle/list";
    }

    @RequestMapping("/saveOrUpdate")
    public String saveOrUpdate(GoodStyle entity) {
        goodStyleService.saveOrUpdate(entity);
        return "redirect:/goodStyle/list.do";
    }
}
